export const userRules = {
  avatar: [{ required: true, message: '头像为必选项', trigger: 'blur' }],
  username: [
    { required: true, message: '用户名为必填项', trigger: 'blur' },
    { min: 4, max: 12, message: '长度在 4 到 12 个字符', trigger: 'blur' }
  ],
  password: [
    { required: true, message: '密码为必填项', trigger: 'blur' },
    { min: 4, max: 12, message: '长度在 4 到 12 个字符', trigger: 'blur' }
  ],
  nickname: [
    { required: true, message: '用户昵称为必填项', trigger: 'blur' },
    { min: 1, max: 10, message: '用户昵称长度在2~10的字符', trigger: 'blur' }
  ],
  email: [
    { required: true, message: '邮箱地址为必填项', trigger: 'blur' },
    { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur'] }
  ],
  role_id: [
    { required: true, message: '角色为必选项', trigger: 'blur' }
  ]
}

export const articleRules = {
  title: [{ required: true, message: '请填写文章内容', trigger: 'blur' }],
  summary: [{ required: true, message: '请填写文章摘要', trigger: 'blur' }],
  category_id: [{ required: true, message: '请选择文章分类', trigger: 'blur' }],
  tags: [{ required: true, message: '请选择文章标签', trigger: 'blur' }],
  status: [{ required: true, message: '请选择文章状态', trigger: 'blur' }],
  thumbnail: [{ required: true, message: '请选择文章封面', trigger: 'blur' }],
  content: [{ required: true, message: '请选择文章内容', trigger: 'blur' }]
}

export const roleRules = {
  name: [{ required: true, message: '请填写角色名', trigger: 'blur' }]
}

export const cateRules = {
  name: [{ required: true, message: '请填写分类名', trigger: 'blur' }]
}

export const tagRules = {
  name: [{ required: true, message: '请填写分类名', trigger: 'blur' }]
}
